
## data blocks
  if ("AGE" %in% option[[i]]){
    h.select.information <- c("age.begin", "age.avg", "age.end", "cases.ingroup")
  } else {h.select.information <- c("week.begin", "week", "week.end", "cases.inweek")
        }

h.dfd.avg <- "dfd.avg"

h.cem.output <- c("cases.in.week.matched", "match.ratio", "controltocase.ratio", "control.turnout.est", "control.turnout.lower", "control.turnout.upper", "widower.effect.est", "widower.effect.pvalue", "widower.effect.upper", "widower.effect.lower", "case.turnout.est", "case.turnout.lower", "case.turnout.upper")

h.sample.age.attributes <- c("ego.age.avg", "ego.age.lowquart", "ego.age.median", "ego.age.highquart", "alter.age.avg", "alter.age.lowquart", "alter.age.median", "alter.age.highquart", "age.at.death", "ea.agediscrep.avg", "ea.agediscrep.median")

h.sample.occupancy.attributes <- c("hid.occnum.avg", "hid.occnum.median")

h.sample.turnout.attributes <- c("turnout.gg10", "turnout.gp10", "turnout.ss9", "turnout.pg8", "turnout.pp8", "turnout.gg6", "turnout.gp6", "turnout.ss5", "turnout.pg4", "turnout.pg8.alter", "turnout.gg6.alter", "turnout.gp6.alter", "turnout.ss5.alter", "turnout.pg4.alter")

h.sample.gender.attributes <- c("female.to.male", "female.ego.age.avg", "female.ego.age.median", "female.alter.avg", "female.alter.age.median", "female.egos", "female.alters",  "male.ego.age.avg", "male.ego.age.median", "male.alter.age.avg", "male.alter.age.median", "male.egos", "male.alters")

h.sample.party.attributes <- c("ego.dem.to.rep", "alter.dem.to.rep", "dem.egos", "dem.alters", "rep.egos", "rep.alters")

h.sample.voting.attributes <- c("same.proportion", "same.count", "more.proportion","more.count", "fewer.proportion","fewer.count", "onevote.pg4throughgg6", "twovotes.pg4throughgg6", "threevotes.pg4throughgg6", "fourvotes.pg4throughgg6", "novotes.pg4throughgg6")

h.sample.popdensity.attributes <- c("pop.density.avg", "pop.density.median")

h.sample.percapitaincome.attributes <- c("percapita.income.avg", "percapita.income.median")

h.sample.regdate.attributes <- c("ego.regdate", "alter.regdate")


## headers

# original
original.sample.header <- c(h.select.information, h.dfd.avg, h.sample.age.attributes, h.sample.occupancy.attributes, h.sample.turnout.attributes, h.sample.gender.attributes, h.sample.party.attributes, h.sample.voting.attributes)

if ("pop.density" %in% names(casecontrol) & "percapita.income" %in% names(casecontrol)){
  original.sample.header <- c(original.sample.header, h.sample.popdensity.attributes, h.sample.percapitaincome.attributes)
}
if ("regdate.e" %in% names(casecontrol) & "regdate.a" %in% names(casecontrol)){
  original.sample.header <- c(original.sample.header, h.sample.regdate.attributes)
}

# matched
matched.sample.header <- c(h.cem.output, original.sample.header)
